package com.puyuba.puyuba.view.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.puyuba.puyuba.R;
import com.puyuba.puyuba.bean.GetTeacherBean;
import com.puyuba.puyuba.view.activity.ChatActivity;
import com.pyb.java.commonutil.ImageHelper;

/**
 * 找老师adapter
 */
public class GetTeacherAdatper extends BaseQuickAdapter<GetTeacherBean.TeacherBean,BaseViewHolder> {

    public GetTeacherAdatper(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, GetTeacherBean.TeacherBean item) {
        ImageView imageView = helper.getView(R.id.iv_msg_user);
        ImageHelper.getInstance()
                .displayWithCorner(imageView,item.getAvatar(),R.mipmap.default_avatar);
        helper.itemView.setOnClickListener(v -> ChatActivity.startActivity(mContext,item.getHx_uid()));

        helper.setText(R.id.tv_title,item.getUname());
        helper.setText(R.id.tv_content,"职务职级："+item.getTitle());
    }
    
}
